package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.CrmCustomerhisMapper;
import com.ruoyi.crm.domain.CrmCustomerhis;
import com.ruoyi.crm.service.ICrmCustomerhisService;

/**
 * 客户信息历史Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-03
 */
@Service
public class CrmCustomerhisServiceImpl implements ICrmCustomerhisService 
{
    @Autowired
    private CrmCustomerhisMapper crmCustomerhisMapper;

    /**
     * 查询客户信息历史
     * 
     * @param crmCustomerhisId 客户信息历史主键
     * @return 客户信息历史
     */
    @Override
    public CrmCustomerhis selectCrmCustomerhisByCrmCustomerhisId(Long crmCustomerhisId)
    {
        return crmCustomerhisMapper.selectCrmCustomerhisByCrmCustomerhisId(crmCustomerhisId);
    }

    /**
     * 查询客户信息历史列表
     * 
     * @param crmCustomerhis 客户信息历史
     * @return 客户信息历史
     */
    @Override
    public List<CrmCustomerhis> selectCrmCustomerhisList(CrmCustomerhis crmCustomerhis)
    {
        return crmCustomerhisMapper.selectCrmCustomerhisList(crmCustomerhis);
    }

    /**
     * 新增客户信息历史
     * 
     * @param crmCustomerhis 客户信息历史
     * @return 结果
     */
    @Override
    public int insertCrmCustomerhis(CrmCustomerhis crmCustomerhis)
    {
        crmCustomerhis.setCreateTime(DateUtils.getNowDate());
        return crmCustomerhisMapper.insertCrmCustomerhis(crmCustomerhis);
    }

    /**
     * 修改客户信息历史
     * 
     * @param crmCustomerhis 客户信息历史
     * @return 结果
     */
    @Override
    public int updateCrmCustomerhis(CrmCustomerhis crmCustomerhis)
    {
        crmCustomerhis.setUpdateTime(DateUtils.getNowDate());
        return crmCustomerhisMapper.updateCrmCustomerhis(crmCustomerhis);
    }

    /**
     * 批量删除客户信息历史
     * 
     * @param crmCustomerhisIds 需要删除的客户信息历史主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerhisByCrmCustomerhisIds(Long[] crmCustomerhisIds)
    {
        return crmCustomerhisMapper.deleteCrmCustomerhisByCrmCustomerhisIds(crmCustomerhisIds);
    }

    /**
     * 删除客户信息历史信息
     * 
     * @param crmCustomerhisId 客户信息历史主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerhisByCrmCustomerhisId(Long crmCustomerhisId)
    {
        return crmCustomerhisMapper.deleteCrmCustomerhisByCrmCustomerhisId(crmCustomerhisId);
    }
}
